/*
 * IMonaReaderProvider.java
 *
 * Created on 2008/09/10 +0900
 *
 * $Revision: 38 $
 * $Date: 2008-10-11 08:48:45 +0000 (Sat, 11 Oct 2008) $
 */

package org.gikolet.bbs.imona.reader;

import org.gikolet.bbs.imona.IMonaProperties;
import org.gikolet.bbs.reader.BbsReaderProvider;
import org.gikolet.bbs.reader.BoardReader;
import org.gikolet.bbs.reader.ThreadHeaderReader;
import org.gikolet.bbs.reader.ThreadReader;
import org.gikolet.framework.inject.Injector;
import org.gikolet.framework.inject.Serviceable;
import org.gikolet.framework.util.Assert;

/**
 * @author tetsutaro (latest modification by $Author: tetsutaro.ss $)
 * @version $Revision: 38 $ $Date: 2008-10-11 08:48:45 +0000 (Sat, 11 Oct 2008) $
 */
public class IMonaReaderProvider implements BbsReaderProvider, Serviceable {
    private Injector injector;

    /**
     * @see org.gikolet.framework.inject.Serviceable#service(org.gikolet.framework.inject.Injector
     *      )
     */
    public void service(Injector injector) {
	this.injector = injector;
    }

    public IMonaProperties getIMonaProperties() {
	Assert.isNotNull(this.injector);

	return (IMonaProperties) this.injector.getInstance(IMonaProperties.class);
    }

    /**
     * @see org.gikolet.bbs.reader.BbsReaderProvider#createBoardReader()
     */
    public BoardReader createBoardReader() {
	return new IMonaBoardReader(getIMonaProperties());
    }

    /**
     * @see org.gikolet.bbs.reader.BbsReaderProvider#createThreadHeaderReader()
     */
    public ThreadHeaderReader createThreadHeaderReader() {
	return null;
    }

    /**
     * @see org.gikolet.bbs.reader.BbsReaderProvider#createThreadReader()
     */
    public ThreadReader createThreadReader() {
	return null;
    }
}
